import { defineStore } from 'pinia'
import type { RouteRecordDto } from '@/api/login/types'
import { DeviceEnum } from '@/const/enum'

export const useBasicStore = defineStore(
    'basic',
    {
        state: () => {
            return {
                menuList: [] as RouteRecordDto[],
                device: DeviceEnum.Desktop,
            }
        },
        actions: {
            setMenuList(menuList: RouteRecordDto[]) {
                this.menuList = menuList
            },
        }
    },
)

// export const useBasicStore = defineStore('basic', () => {
//     const menuList = ref<RouteRecordDto[]>([])
//     const device = ref(DeviceEnum.Desktop)

//     const setMenuList = (list: RouteRecordDto[]) => {
//         menuList.value = list
//     }

//     const setDevice = (d: DeviceEnum) => {
//         device.value = d
//     }

//     return { menuList: [] as RouteRecordDto[], device, setMenuList, setDevice }
// })